﻿using System;
using System.Linq;
using DotNETStack.LinqToSqlDataProvider.Model;

namespace DotNETStack.LinqToSqlDataProvider.Data
{
    public static class QuestionExtensions
    {
        public static IQueryable<dns_Question> WithId(this IQueryable<dns_Question> q, Int32 id)
        {
            return q.Where(p => p.QuestionId == id);
        }

        public static IQueryable<dns_Question> Paged(this IQueryable<dns_Question> q, Int32 PageIndex, Int32 PageSize)
        {
            return q.Skip(PageIndex * PageSize).Take(PageSize);
        }
    }
}